<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/react.development.js"></script>
    <script src="./lib/react-dom.development.js"></script>
    <script src="./lib/babel.min.js"></script>
</head>
<body>
<div id="root">

</div>

</body>
<script type="text/babel">
    // 通过bind解决，用的是最多的。
    const root = ReactDOM.createRoot(document.querySelector("#root"));
    class App extends React.Component{
        constructor() {
            super();
            this.num = 100;
            this.clickHandler = this.clickHandler.bind(this,1,2,3,4);
        }
        clickHandler(a,b,c,d,f){
            console.log(this,"clickHandler",a,b,c,d,f)
        }
        render(){
            return (
                <div>
                    <h3>App</h3>
                    <button onClick={this.clickHandler}>你过来呀！点我呀！</button>
                    <button onClick={this.clickHandler}>你过来呀！点我呀！</button>
                    <button onClick={this.clickHandler}>你过来呀！点我呀！</button>
                </div>
            )
        }
    }
    root.render(<App/>)
</script>
</html>